package com.athena.dal.entities;

import java.io.Serializable;
import java.sql.Timestamp;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;


/**
 * The persistent class for the user database table.
 * 
 */
@Entity
@Table(name="user")
@PrimaryKeyJoinColumn(name="id")
@NamedQueries({
	@NamedQuery(name="User.findByUsername", query="SELECT u FROM User u WHERE LOWER(u.username) = LOWER(:username)")
})
public class User extends Person implements Serializable {
	private static final long serialVersionUID = 1L;


	private Timestamp lastlogin;

	@Column(length=256)
	private String password;

	@Column(nullable=false)
	private int permission;

	@Column(nullable=false)
	private int role;

	@Column(length=128)
	private String securityAnswer;

	@Column(length=128)
	private String securityQuestion;

	@Column(nullable=false)
	private Timestamp updatedAt;

	@Column(nullable=false, length=32)
	private String username;


	public User() {
	}



	public Timestamp getLastlogin() {
		return this.lastlogin;
	}

	public void setLastlogin(Timestamp lastlogin) {
		this.lastlogin = lastlogin;
	}

	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public int getPermission() {
		return this.permission;
	}

	public void setPermission(int permission) {
		this.permission = permission;
	}

	public int getRole() {
		return this.role;
	}

	public void setRole(int role) {
		this.role = role;
	}

	public String getSecurityAnswer() {
		return this.securityAnswer;
	}

	public void setSecurityAnswer(String securityAnswer) {
		this.securityAnswer = securityAnswer;
	}

	public String getSecurityQuestion() {
		return this.securityQuestion;
	}

	public void setSecurityQuestion(String securityQuestion) {
		this.securityQuestion = securityQuestion;
	}

	public Timestamp getUpdatedAt() {
		return this.updatedAt;
	}

	public void setUpdatedAt(Timestamp updatedAt) {
		this.updatedAt = updatedAt;
	}

	public String getUsername() {
		return this.username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

}